{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "85df8d9a",
   "metadata": {},
   "source": [
    "------\n",
    "* AI-NLP:自然语言处理（Natural Language Processing)）\n",
    "* date:week09\n",
    "\n",
    "------\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fe0bfcfc",
   "metadata": {},
   "source": [
    "# 本周内容\n",
    "\n",
    "## 自然语言处理\n",
    "> 1. [什么是语言？](https://www.bilibili.com/video/BV1vW411a7jY/?spm_id_from=333.999.0.0&vd_source=79597b80e427bf7da87d79b5fa58a48e)\n",
    ">> 1. 语言的本身\n",
    ">> 1. 语言的隐喻\n",
    "> 2. [什么是自然语言处理？](https://www.bilibili.com/video/BV18x411L7dz/?spm_id_from=333.999.0.0&vd_source=79597b80e427bf7da87d79b5fa58a48e)\n",
    ">> 1. Machin Translation（机器翻译）：谷歌、有道翻译\n",
    ">> 1. Chinese word segmentation（中文自动分词）：[锤子手机大爆炸](https://www.bilibili.com/video/BV1uJ41127wY/?spm_id_from=333.337.search-card.all.click&vd_source=79597b80e427bf7da87d79b5fa58a48e)\n",
    ">> 1. Question Answering（问答系统）：openai、文心一言\n",
    ">> 1. Information Extracting（信息抽取）\n",
    ">> 1. Reading comprehension（阅读理解）\n",
    ">> 1. Automatic summarization(自动摘要)\n",
    ">> 1. Text categorization（文本分类）\n",
    "> 3. [计算机也能理解语言么](https://www.bilibili.com/video/BV1qW411Z7hy/?spm_id_from=333.999.0.0&vd_source=79597b80e427bf7da87d79b5fa58a48e)\n",
    "> 4. [词向量是什么](https://www.bilibili.com/video/BV11N41197nq/?spm_id_from=333.999.0.0&vd_source=79597b80e427bf7da87d79b5fa58a48e)\n",
    "\n",
    "\n",
    "\n",
    "## 百度AI实践\n",
    "> 1. 自然语言处理文本信息（实践）\n",
    "> 1. 自然语言生成文本信息（实践）\n",
    "\n",
    "## 对话机器人\n",
    "\n",
    "> 1. 对话机器人（实践）\n",
    "\n",
    "## [OpenAi接入教程](https://www.bilibili.com/video/BV1rs4y187gi/?spm_id_from=333.337.search-card.all.click&vd_source=79597b80e427bf7da87d79b5fa58a48e)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5dfdb2ed",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0a5efe6b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d37b8f15",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "a5972c64",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests,json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "c962ea01",
   "metadata": {},
   "outputs": [],
   "source": [
    "url = 'http://openapi.turingapi.com/openapi/api/v2'\n",
    "data = {\n",
    "    \"reqType\":0,\n",
    "    \"perception\": {\n",
    "        \"inputText\": {\n",
    "            \"text\": \"聊点什么呢\"\n",
    "        },\n",
    "        \"inputImage\": {\n",
    "            \"url\": \"\"\n",
    "        },\n",
    "\n",
    "    },\n",
    "    \"userInfo\": {\n",
    "        \"apiKey\": \"d5d5bb66f66d4da8bedb378df7adfa70\",\n",
    "        \"userId\": \"111\"\n",
    "    }\n",
    "}\n",
    "\n",
    "r = requests.post(url,json.dumps(data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "9bc4a7b8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "6390d0c8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'emotion': {'robotEmotion': {'a': 0, 'd': 0, 'emotionId': 0, 'p': 0},\n",
       "  'userEmotion': {'a': 0, 'd': 0, 'emotionId': 0, 'p': 0}},\n",
       " 'intent': {'appKey': 'platform.chat', 'code': 0, 'operateState': 1100},\n",
       " 'results': [{'groupType': 0,\n",
       "   'resultType': 'text',\n",
       "   'values': {'text': '随便呀，我听你的'}}]}"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "62322abf",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
